package qihe.controller;

import qihe.entity.qiheEntity;
import qihe.service.qiheService;

import javax.annotation.Resource;
import java.util.List;

public class qiheController {
    List<qiheEntity> list = null;
    qiheEntity qihEntity=null;
    String name = null;
    String flag = "0";
    @Resource
    qiheService qihservice;

    public String queryPage(){
        list =qihservice.queryPage(name);
        return "queryPage";
    }

    public String save(){
        qihservice.save(qihEntity);
        flag = "1";
        return "save";
    }
//@Resource @Autowired 作用相同 去spring容器中到bean实例
    //@Service @Component 向spring 容器中放入bean（类的对象）实例


    public List<qiheEntity> getList() {
        return list;
    }

    public void setList(List<qiheEntity> list) {
        this.list = list;
    }

    public qiheEntity getQihEntity() {
        return qihEntity;
    }

    public void setQihEntity(qiheEntity qihEntity) {
        this.qihEntity = qihEntity;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getFlag() {
        return flag;
    }

    public void setFlag(String flag) {
        this.flag = flag;
    }

    public qiheService getQihservice() {
        return qihservice;
    }

    public void setQihservice(qiheService qihservice) {
        this.qihservice = qihservice;
    }
}
